package org.zcl.service.game;


import org.zcl.service.game.enums.CityEnum;
import org.zcl.service.game.model.Gun;
import org.zcl.service.game.model.Person;

/**
 * @author zhuchenglin
 * @since 2023/12/14 17:36
 */
public abstract class AbstractGameService<B> implements GameService<Person, Gun>, MapService<B> {

    protected final CityEnum cityEnum;

    protected AbstractGameService(CityEnum cityEnum) {
        this.cityEnum = cityEnum;
    }

    protected abstract boolean play(B convert);

    @Override
    public Person select(Gun gun) {
        B map = map(gun.getSuitableMap());
        boolean result = play(map);
        Person person = new Person();
        if (result) {
            person.setName("蕾兹");
        } else {
            person.setName("烈枭");
        }
        return person;
    }


}
